import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    userInfo: null,
    token: null,
  },
  
  mutations: {
    login_success(state, payload) {
      state.userInfo = payload.userInfo
      state.token = payload.token
    }
  }
})

export default store
